<?php

namespace app\common\validate\Airline;
use think\Validate;

class Points extends Validate
{
    // 验证规则
    protected $rule = [
        /* 
            require => 字段必填
            regex => 正则验证
            unique => 验证字段值在指定表或模型是否为唯一 
        */
        'airline_id' => ['require'],
        'is_start_point' => ['require'],
        'is_end_point' => ['require'],

    ];

    // 错误提示信息
    protected $message = [
        'airline_id.require' => '所属航线必填',
        'is_start_point.require' => '是否航线起点必填',
        'is_end_point.require' => '是否航线终点必填',
    ];

    // 验证场景
    protected $scene = [
        'add' => ['airline_id','is_start_point','is_end_point'],
    ];
}
